;;;;;; test-lexer.scm - Lexical Analyzer test module.    -*- Mode: Scheme -*-
;;;;;; Author: Erik Silkensen <silkense@colorado.edu>
;;;;;; Version: 28 Jun 2009

(require "../lexer.scm")

(printf ";; Lexical Analyzer test REPL~n")
(printf ";; Use Ctrl-D (i.e., EOF) to exit.~n")
(port-count-lines! (current-input-port))
(let ((prompt "> "))
  (display prompt)
  (flush-output)
  (let repl ((token (read-token)))
    (if token
        (begin (pretty-print (cdr token))
               (display prompt)
               (flush-output)
               (repl (read-token)))
        (newline))))
